package test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.DrawControl;

import android.graphics.Canvas;
import android.graphics.Paint;

import test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.model.CircleModel;

/**
 * Author : Cooper
 * Time : 2016/10/9  18:26
 * Description : 圆圈Control
 */

public class CircleControl extends DrawControl {

    private CircleModel circleModel;

    public CircleControl(Canvas canvas, CircleModel circleModel) {
        super(canvas);
        this.circleModel = circleModel;
    }

    @Override
    public void beginDraw() {
        paint.setColor(circleModel.getColor());
        paint.setStyle(Paint.Style.STROKE);
        paint.setStrokeWidth(circleModel.getStrokeWidth());
        mCanvas.drawCircle(circleModel.getCx(),circleModel.getCy(),circleModel.getRadius(),paint);
    }
}
